package org.springblade.modules.repair.controller;

import org.springblade.core.tool.api.R;
import org.springblade.modules.repair.service.IMaintainPlanContentService;
import org.springblade.modules.repair.vo.ElevatorFilesPlanListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Date 10:26 2023/10/31
 * @Description {
 *   电梯档案
 * }
 * @Author lsay
 **/
@RestController
@RequestMapping("/elevator/files")
public class ElevatorFilesController {

	@Autowired
	private IMaintainPlanContentService planContentService;

	/**
	 * @Author lsay
	 * @Description {
	 *   维保历史 电梯工单全部
	 * }
	 * @Date 10:50 2023/11/1
	 * @Param
	 * @return
	 **/
	@GetMapping("/plan/list")
	public R<Map<String,Object>> selectElevatorFilesAllPlan(Long elevatorId, String startDate, String endDate){
		return R.data(planContentService.selectElevatorFilesAllPlan(elevatorId,startDate,endDate));
	}

	/**
	 * @Author lsay
	 * @Description {
	 *   维保历史 部件工作项全部
	 * }
	 * @Date 8:51 2023/11/2
	 * @Param
	 * @return
	 **/
	@GetMapping("/plan/work/item/all")
	public R<Map<String,Object>> selectElevatorFilesAllPlanWorkItem(Long elevatorId, Long partsId, String startDate, String endDate,
																	@RequestParam(required = false) Long floorStandIds){
		return R.data(planContentService.selectElevatorFilesAllPlanWorkItem(elevatorId,partsId,startDate,endDate,floorStandIds));
	}

	/**
	 * @Author lsay
	 * @Description {
	 *   维保历史 部件工作项保养
	 * }
	 * @Date 8:51 2023/11/2
	 * @Param
	 * @return
	 **/
	@GetMapping("/plan/work/item/by")
	public R<Map<String,Object>> selectElevatorFilesByPlanWorkItem(Long elevatorId,Long partsId,String startDate,String endDate){
		return R.data(planContentService.selectElevatorFilesByPlanWorkItem(elevatorId,partsId,startDate,endDate));
	}

	/**
	 * @Author lsay
	 * @Description {
	 *   维保历史 部件工作项维修
	 * }
	 * @Date 8:51 2023/11/2
	 * @Param
	 * @return
	 **/
	@GetMapping("/plan/work/item/wx")
	public R<Map<String,Object>> selectElevatorFilesWxPlanWorkItem(Long elevatorId,Long partsId,String startDate,String endDate, @RequestParam(required = false) Long floorStandIds){
		return R.data(planContentService.selectElevatorFilesWxPlanWorkItem(elevatorId,partsId,startDate,endDate, floorStandIds));
	}

	/**
	 * @Author lsay
	 * @Description {
	 *   维保历史 部件工作项配件
	 * }
	 * @Date 8:51 2023/11/2
	 * @Param
	 * @return
	 **/
	@GetMapping("/plan/work/item/pj")
	public R<Map<String,Object>> selectElevatorFilesPjPlanWorkItem(Long elevatorId,Long partsId,String startDate,String endDate, @RequestParam(required = false) Long floorStandIds){
		return R.data(planContentService.selectElevatorFilesPjPlanWorkItem(elevatorId,partsId,startDate,endDate, floorStandIds));
	}

}
